import request from '@/utils/request'
// import Ts类型时(最常见intereface)需要在前面加个type，既容易阅读还能进行类型检查j
import type {
  loginFormData,
  loginResponseData,
  userInfoReponseData,
} from './type'

enum API {
  LOGIN_URL = '/user/login',

  USERINFO_URL = '/user/info',
}

export const reqLogin = (data: loginFormData) =>
  request.post<any, loginResponseData>(API.LOGIN_URL, data)

export const reqUserInfo = () =>
  request.get<any, userInfoReponseData>(API.USERINFO_URL)
